package com.example.onlinemarket.dao;

import com.example.onlinemarket.bean.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.Date;
import java.util.List;
@Mapper
public interface OrderDao {
    Order getOrderByOrderId(Integer orderId);
    List<Order> getOrdersByUserId(@Param("userId")Integer userId, @Param("status") String status);//按订单状态、用户ID获取订单
    Integer addOrder(@Param("userId") Integer userId, @Param("date") Date date, @Param("shopId") int shopId, @Param("shopName")String shopName);//添加新订单
    boolean delOrderById(Integer orderId);
    boolean updateOrderStatus(@Param("orderId") Integer orderId, @Param("time") Date time, @Param("status") String status, @Param("address") String address);//更新订单状态和订单时间
    List<Order> getShopOrders(@Param("userId") Integer userId, @Param("orderStatus") String orderStatus);//按商家ID获取特定状态订单
    boolean updateOrderCount(@Param("orderId") Integer orderId, @Param("count") Double count);//改变订单总额
    List<Order> getUserOrdersInStatus(@Param("userId") Integer userId, @Param("orderStatus") String orderStatus);//按订单状态获取用户订单
    Order getOrder(@Param("userId") int userId, @Param("shopId") int shopId);
    List<Order> getShoppingOrders(int userId);
    void updateOrderNote(@Param("orderId") int orderId, @Param("note")String note);
    String getOrderStatus(int orderId);
    void updateOrder(@Param("orderId")int orderId, @Param("orderStatus")String orderStatus);
}
